package com.langyiquan.front.config;

import com.langyiquan.service.SmsService;
import com.langyiquan.service.impl.AliSmsServiceImpl;
import com.langyiquan.service.impl.KingttoSmsServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SmsConfiguration {

    @Bean
    @ConditionalOnProperty(name = "sms", havingValue = "ali")
    public SmsService aliSmsServiceImpl(){
        return new AliSmsServiceImpl();
    }

    @Bean
    @ConditionalOnProperty(name = "sms", havingValue = "kingtto")
    public SmsService kingttoSmsServiceImpl(){
        return new KingttoSmsServiceImpl();
    }

}
